# coding:utf-8
'''
Created on 2011-3-3

@author: xi_li
'''

def buildConnectionString(params):
    """通过params参数中传递来的数据，构建一个连接ODBC的url字符串
并返回该字符串"""
    return ";".join(["%s=%s" % (k, v) for k, v in params.items()])

if __name__ == "__main__":
    myParams = {"server":"localhost", \
                "database" : "master", \
                "username" : "sa", \
                "password" : "secret"}
    print buildConnectionString(myParams)
